﻿	      <?php include("conn.php");
             mysql_query('SET NAMES UTF8'); 

	  

class MyPrizeBean
{
	public $title;
	public $price;
	public $images;
	public $yuanjia;
	public $goodsid;
	public $reply;
	public $xihuan;
	public $summary;

	function __construct($title,$price,$images,$yuanjia,$goodsid,$reply,$xihuan,$summary)
	{
		$this->title      = $title;
		$this->price = $price;
		$this->images     = $images;
		$this->yuanjia      = $yuanjia;
		$this->goodsid    = $goodsid;
		$this->reply    = $reply;
		$this->xihuan    = $xihuan;
		$this->summary    = $summary;
	}
}

if($_REQUEST['page']!="")
{
$de=$_REQUEST['page']*$_REQUEST['pagesize'];
$size=$_REQUEST['pagesize'];
}

else
{
$de=0;
$size=5;
}


     $sj=1;
if ($_REQUEST[keywords]!='') {
	$rert30=mysql_query("select *from goods  where  city='".$_REQUEST[cityid]."' and title like '".$_REQUEST['keywords']."%' and shangjia='".$sj."' order by goodsid desc limit $de,$size");
}else{
	$rert30=mysql_query("select *from goods  where  city='".$_REQUEST[cityid]."' and shangjia='".$sj."' order by goodsid desc limit $de,$size");
}
	
	$prize = array();
	
	while($rowf=mysql_fetch_array($rert30)){
	
	
	
	

			$prize[] = new MyPrizeBean($rowf['title'],$rowf['price'],$rowf['images'],$rowf['yuanjia'],$rowf['goodsid'],$rowf['replynumber'],$rowf['xihuan'],$rowf['summary']);
		
	}

echo json_encode($prize);


?>